from django_filters import rest_framework as filters

from saas_main import models


class IssueFilter(filters.FilterSet):
    attention = filters.ModelMultipleChoiceFilter(queryset=models.User.objects.all(), conjoined=True)

    class Meta:
        model = models.Issues
        # fields = ['issues_type', 'priority', 'status', 'assign', 'creator', 'attention']
        fields = {
            'issues_type': ['in'],
            'priority': ['in'],
            'status': ['in'],
            'assign': ['in'],
            # 'attention': ['exact'],
            'creator': ['exact']
        }
